<template>
  <div class="">
      <broadcast></broadcast>
  </div>
</template>

<script type="text/javascript">
import broadcast from './broadcast.vue'
export default {
  name: 'componentB',
  created () {
    this.$on('on-message', this.showMessage);
  },
  components: {
      broadcast
  },
  methods: {
    showMessage (text) {
      window.alert(text);
    }
  }
}
</script>

<style lang="less" scoped>
</style>
